home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / PDOS / TN.PDOS.029 < prev   
Encoding:
Text File  |  1990-09-21  |  3.3 KB  |  102 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6. ProDOS 8
  7. #29:    Clearing the Backup Needed Bit
  8.  
  9. Written by:    Jim Luther                                      September 1990
  10.  
  11. This Technical Note shows how to clear the "backup needed bit" in a directory 
  12. entry's access byte.
  13. _____________________________________________________________________________
  14.  
  15. If you are writing a file backup utility program, you probably want to clear 
  16. the backup needed bit in each directory entry's access byte as you make the 
  17. backup of the file associated with that directory entry.  The SET_FILE_INFO 
  18. MLI call normally sets the backup needed bit of the access byte, but how do 
  19. you clear it?  The answer is at location BUBIT ($BF95) on the ProDOSĀ 8 system 
  20. global page.
  21.  
  22. BUBIT normally contains the value $00.  When BUBIT contains $00, the 
  23. SET_FILE_INFO MLI call always sets the backup needed bit in the directory 
  24. entry's access byte.  However, if the value $20 is stored in BUBIT immediately 
  25. before calling SET_FILE_INFO, the backup needed bit in the directory entry's 
  26. access byte can be cleared.  BUBIT is set back to $00 by the MLI call.  The 
  27. following code example shows how to clear the backup needed bit.  Values other 
  28. than $20 or $00 in BUBIT are not supported.
  29.  
  30. ; The pathname of the file should be in ThePathname buffer when this code is 
  31. called!
  32.  
  33.                65816 off
  34.                longa off
  35.                longi off
  36.  
  37. ClearBackupBit start
  38.  
  39. ; System global page locations
  40.  
  41. MLI            equ $BF00              ;MLI call entry point
  42. BUBIT          equ $BF95              ;Backup Bit Disable, SET_FILE_INFO only
  43.  
  44. ; MLI call numbers
  45.  
  46. SET_FILE_INFO  equ $C3
  47. GET_FILE_INFO  equ $C4
  48.  
  49. ; set up FileInfoParms for GET_FILE_INFO MLI call
  50.                lda #$0A
  51.                sta param_count
  52. ; then...
  53.                jsr MLI                  ;get the current file info
  54.                dc  I1'GET_FILE_INFO'
  55.                dc  I2'FileInfoParms'
  56.                bne Error
  57.  
  58.                lda #$20                 ;set the backup bit disable bit
  59.                sta BUBIT
  60.                eor #$FF
  61.                and access               ;clear the backup needed bit
  62.                sta access
  63.  
  64. ; set up FileInfoParms for SET_FILE_INFO MLI call
  65.                lda #$07
  66.                sta param_count
  67. ; then...
  68.                jsr MLI                  ;set the file info with the file info
  69.                dc  I1'SET_FILE_INFO'   ;(clearing only the backup needed bit)
  70.                dc  I2'FileInfoParms'
  71.                bne Error
  72.                rts                      ;return to caller
  73.  
  74. Error          anop                     ;routine to handle MLI errors
  75.                rts
  76.  
  77. ; Parameter block used for GET_FILE_INFO and SET_FILE_INFO MLI calls
  78.  
  79. FileInfoParms  anop
  80. param_count    ds  1
  81. pathname       dc  i2'ThePathname'
  82. access         ds  1
  83. file_type      ds  1
  84. aux_type       ds  2
  85. storage_type   ds  1
  86. blocks_used    ds  2
  87. mod_date       ds  2
  88. mod_time       ds  2
  89. create_date    ds  2
  90. create_time    ds  2
  91.  
  92. ThePathname    entry
  93.                ds  65                   ;store the pathname of the file here
  94.  
  95.                end
  96.  
  97.  
  98. Further Reference
  99. _____________________________________________________________________________
  100.   o  ProDOS 8 Technical Reference Manual
  101.  
  102.